/*
 * @Author: RidingWind
 * @Date: 2018-02-09 14:43:02
 * @Last Modified by: 大招科技 - RidingWind
 * @Last Modified time: 2018-03-06 16:17:52
 */
import $ from 'jquery';
import template from './template';
import TOAST from '../utils/toast';
import ajax from '../utils/request';

ajax('/like-k/SZ000623/history', 'GET', { mobile: '15759580813' }).done((data) => {
  // alert(data);
  if (data.success) {
    TOAST.show('读取成功', { delay: 800 });
    console.log(data.result);
  }
});

/* ---------------------- DATA begin -------------------------- */
const DATAs = [];
const obj = {
  id: '122031217',
  name: '张三',
  phone: '15759580000',
  adr: '福建 . 漳州',
  text: '哈哈哈',
};

for (let i = 0; i < 10; i += 1) {
  DATAs.push(obj);
}

/* ---------------------- DATA end -------------------------- */

/* ---------------------- main begin -------------------------- */
const $tbody = $('.tbody');
DATAs.forEach((item) => {
  const itemDOM = $(template(item));
  $tbody.append(itemDOM);
});
/* ---------------------- main end -------------------------- */

// console.log($, DATAs);
